package com.sowka.miko.util;

import org.osgi.framework.ServiceException;
import org.osgi.service.prefs.Preferences;
import org.osgi.service.prefs.PreferencesService;

public class Prefs {
	
	private static PreferencesService prefsService = null;
	
	public final static String DEFAULT_PROVIDER = "defaultProvider";
	public final static String DEFAULT_PROVIDER_DEFAULT = "google";
	
	public static void intitialize() {
		
	}
	
	public static Preferences getPreferences() throws ServiceException {
		if (prefsService == null) {
			throw new ServiceException("Preferences service not registered");
		}
		return prefsService.getSystemPreferences();
	}
	
	public void bindPrefs(PreferencesService service) {
		prefsService = service;
	}
	
	public void unbindPrefs(PreferencesService servie) {
		prefsService = null;
	}
}
